package ru.spbu.mm.diploma.common.facade;

import ru.spbu.mm.diploma.common.entity.User;
import ru.spbu.mm.diploma.server.dao.DAOBean;

import java.util.List;

public class UserFacadeImpl implements IUserFacade {
    private static UserFacadeImpl instance = new UserFacadeImpl();

    public static UserFacadeImpl getInstance() {
        return instance;
    }

    private UserFacadeImpl() {
    }

    public User getUserWithUsername(String username) {
        return DAOBean.userDAO.getUserWithUsername(username);
    }

    public void addUser(User user) {
        DAOBean.userDAO.addUser(user);
    }

    public void deleteUser(User user) {
        DAOBean.userDAO.deleteUser(user);
    }

    public List<User> getUsers() {
        return DAOBean.userDAO.getUsers();
    }
}
